package com.easyedu.core.exception;

import com.easyedu.core.entity.EasyEduError;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author mengranliu
 * @date 2022/3/20
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EasyEduException extends RuntimeException {
     /**
      * 状态码
      **/
     protected Integer code;
     /**
      * 异常信息
      **/
     protected String msg;

     public EasyEduException(EasyEduError easyEduError) {
          this.code = easyEduError.getCode();
          this.msg = easyEduError.getMsg();
     }

     public EasyEduException(EasyEduError easyEduError, String msg) {
          this.code = easyEduError.getCode();
          this.msg = msg;
     }
}

